﻿CREATE PROCEDURE [dbo].[spDropFactTrackSalesIndex]

AS
BEGIN
	IF EXISTS(SELECT * FROM sys.indexes WHERE object_id = object_id('FactTrackSales') AND NAME ='NIX_FactTrackSales_Date')
		DROP INDEX [NIX_FactTrackSales_Date] ON [dbo].[FactTrackSales]

	IF EXISTS(SELECT * FROM sys.indexes WHERE object_id = object_id('FactTrackSales') AND NAME ='NIX_FactTrackSales_TrackId')
		DROP INDEX [NIX_FactTrackSales_TrackId] ON [dbo].[FactTrackSales]

	IF EXISTS(SELECT * FROM sys.indexes WHERE object_id = object_id('FactTrackSales') AND NAME ='NIX_FactTrackSales_GenreId')
		DROP INDEX [NIX_FactTrackSales_GenreId] ON [dbo].[FactTrackSales]

	IF EXISTS(SELECT * FROM sys.indexes WHERE object_id = object_id('FactTrackSales') AND NAME ='NIX_FactTrackSales_MediaTypeId')
		DROP INDEX [NIX_FactTrackSales_MediaTypeId] ON [dbo].[FactTrackSales]

	IF EXISTS(SELECT * FROM sys.indexes WHERE object_id = object_id('FactTrackSales') AND NAME ='NIX_FactTrackSales_CustomerId')
		DROP INDEX [NIX_FactTrackSales_CustomerId] ON [dbo].[FactTrackSales]

END
